temp = input("请输入一个带有符号的温度值：")

if temp.endswith('c') or temp.endswith('C'):
    c = eval(temp[:-1])
    f = c * 1.8 + 32
    print(f, "F")
elif temp.endswith('f') or temp.endswith('F'):
    f = eval(temp[:-1])
    c = (f - 32) / 1.8
    print(c, "C")
else:
    print("输入错误")